<template>
  <div id="KeyCheckNInfo">
    <!--<div class="title">-->
      <!--<span @click="onClickLeft" style="position: absolute;left: 5px;display: flex;align-items: center;font-size: 14px;">-->
        <!--<van-icon name="arrow-left" />-->
        <!--返回-->
      <!--</span>-->
      <!--详细信息-->
    <!--</div>-->
    <div class="top">
      <img style="margin: 0 auto" src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/YPC/1.png" />
      <p>
        <span style="width: 125px;display: inline-block;text-align: left">基本信息</span>
        <span style="width: 150px;display: inline-block;text-align: right">排查信息</span>
      </p>
    </div>
    <div class="content">
      <p style="height: 50px;display: flex;align-items: center;border-bottom: 1px solid #D2D2D2;">
        <span style="margin-right: 10px;" class="line"></span>
        基本信息
      </p>
      <div class="list">
        <ul>
          <li v-for="(item,index) in JBXXcontentData" :key="index+'JBXXcontentData'" :style="{borderBottom:index===JBXXcontentData.length-1?'none':'1px solid #D2D2D2'}">
            <span style="margin-right: 20px;font-size: 14px;">{{item.name}}</span>
            <span v-if="item.children" style="float: right;font-size: 14px;">{{rowData[item.value] | inUseName(item.children)}}</span>
            <span v-else style="float: right;font-size: 14px;">{{rowData[item.value]}}</span>
          </li>
        </ul>
      </div>
      <p style="text-align: right">
        <van-button @click="locateMapUrl" type="primary" size="small">定位</van-button>
      </p>
      <p style="height: 50px;display: flex;align-items: center;border-bottom: 1px solid #D2D2D2;">
        <span style="margin-right: 10px;" class="line"></span>
        排查信息
      </p>
      <div class="list">
        <div>
          <ul>
            <li style="border-bottom:1px solid #D2D2D2;">
              <van-field
                readonly
                clickable
                name="datetimePicker"
                :value="formDataGZ.F_TROUBLESHOOTINGTIME"
                label="排查时间："
                placeholder="请选择排查时间"
                @click="selectData.showPickerq = true"
              />
              <van-popup v-model="selectData.showPickerq" position="bottom">
                <van-datetime-picker v-model="selectData.currentDate" type="date" title="选择年月日" @cancel="selectData.showPickerq = false" @confirm="onConfirmRQ" />
              </van-popup>
            </li>
            <li style="border-bottom:1px solid #D2D2D2;">
              <van-field
                v-model="formDataGZ.F_TROUBLESHOOTINGREN"
                placeholder="请输入排查人"
                label="排查人"
              />
            </li>

          </ul>
        </div>
        <ul>
          <li v-for="(item,index) in contentData" :key="index+'contentData'" :style="{borderBottom:index===contentData.length-1?'none':'1px solid #D2D2D2'}">
            <span style="color: #007AFF;">{{item.name}}</span>
            <div v-if="item.value"  size="mini">
              <p
                class="btn-style"
                v-for="(item1,index1) in item.children"
                :style="{borderBottom:item.children.length-1===index1?'none':''}"
                :label="item1.name"
              >
                <span style="width: 60%;display: inline-block;line-height: initial;">{{item1.name}}</span>
                <span v-if="item.type"  style="float: right;padding-top: 10px;">
                   <van-radio-group v-model="formDataGZ[item1.key]" direction="horizontal">
                    <van-radio
                      v-for="(iftem,ifindex) in IFYSWF"
                      :key="ifindex"
                      :name="iftem.DICID">
                      {{iftem.DICNAME}}
                    </van-radio>
                   </van-radio-group>
                </span>
                <span v-else  style="float: right;padding-top: 10px;">
                   <van-radio-group v-model="formDataPC[item1.key]" direction="horizontal">
                    <van-radio name="1">是</van-radio>
                    <van-radio name="2">否</van-radio>
                   </van-radio-group>
                </span>
              </p>
              <div
                v-for="(item2,index2) in item.fileData"
                :key="index2+'fileData'"
              >
                <p style="font-size: 14px">{{item2.name}}</p>
                <van-uploader
                  @click-upload="getList(item2)"
                  :after-read="afterRead"
                  :before-delete="delectFile"
                  v-model="item2.fileList"
                  accept=".jpg,.gif,.png,.jpeg" multiple />
              </div>
            </div>
            <div
              v-if="!item.value"
              v-for="(item1,index1) in item.children"
              :key="index1"
            >
              <span style="font-size: 14px;font-weight: bold;">{{item1.name}}</span>
              <div size="mini">
                <p
                  class="btn-style"
                  v-for="(item2,index2) in item1.children"
                  :label="item2.name"
                  :key="index2"
                >
                  <span style="width: 60%;display: inline-block;line-height: initial;">{{item2.name}}</span>
                  <span style="float: right;padding-top: 10px;">
                   <van-radio-group v-model="formDataPC[item2.key]" direction="horizontal">
                    <van-radio name="1">是</van-radio>
                    <van-radio name="2">否</van-radio>
                </van-radio-group>
                </span>
                </p>
              </div>

            </div>
            <div
              v-if="!item.value"
              v-for="(item2,index2) in item.fileData"
            >
              <p style="font-size: 14px">{{item2.name}}</p>
              <van-uploader
                @click-upload="getList(item2)"
                :after-read="afterRead"
                :before-delete="delectFile"
                v-model="item2.fileList"
                accept=".jpg,.gif,.png,.jpeg" multiple />
            </div>
          </li>
        </ul>
      </div>
      <!--<p style="height: 50px;display: flex;align-items: center;border-bottom: 1px solid #D2D2D2;margin-bottom: 20px;">-->
        <!--<span style="margin-right: 10px;" class="line"></span>-->
        <!--排查照片-->
      <!--</p>-->
      <!--<div>-->
        <!--&lt;!&ndash;<el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false">&ndash;&gt;-->
          <!--&lt;!&ndash;<i v-else class="el-icon-plus avatar-uploader-icon"></i>&ndash;&gt;-->
        <!--&lt;!&ndash;</el-upload>&ndash;&gt;-->
        <!--<van-uploader-->
          <!--:after-read="afterRead"-->
          <!--:before-delete="delectFile"-->
          <!--v-model="fileList"-->
          <!--multiple-->
        <!--/>-->
      <!--</div>-->
      <!--<div>-->
        <!--<p style="color: #007AFF;">结论</p>-->
        <!--<van-field-->
          <!--clickable-->
          <!--readonly-->
          <!--:value="selectData.F_HEALTH"-->
          <!--label="健康度"-->
          <!--placeholder="请选择健康度"-->
          <!--@click="selectData.HEALTH = true"-->
        <!--/>-->
        <!--<van-popup v-model="selectData.HEALTH" position="bottom">-->
          <!--<van-picker show-toolbar :columns="selectData.HEALTHARR" value-key="DICNAME"  @confirm="confirmHEALTH" @cancel="selectData.HEALTH = false" />-->
        <!--</van-popup>-->
        <!--<van-field-->
          <!--clickable-->
          <!--readonly-->
          <!--:value="selectData.ISYSWF"-->
          <!--label="是否疑似危房"-->
          <!--placeholder="请选择是否疑似危房"-->
          <!--@click="selectData.IS1 = true"-->
        <!--/>-->
        <!--<van-popup v-model="selectData.IS1" position="bottom">-->
          <!--<van-picker show-toolbar :columns="selectData.ISARR1"   @confirm="confirmIS" @cancel="selectData.IS1 = false" />-->
        <!--</van-popup>-->
        <div style="text-align: center;padding: 10px 0 ">
          <el-button @click="saveData" type="primary" size="mini">确定</el-button>
        </div>
      <!--</div>-->
    </div>
  </div>
</template>
<script>
  import {
    InsertDataView,
    dataServerOpenDataView,
    updateDataView,
    FileServerUpload,
    GetFileData,
    DelectFile,
    dataTransFilePreview,
    FileServerProxy,
    dataTransFile
  } from '../../../utils/api'
export default {
  data () {
    return {
      fileList:[],
      formDataGZ:{
        F_TROUBLESHOOTINGREN:'',
        F_TROUBLESHOOTINGTIME:'',
        F_SF_DANGEROUS:'',
        // F_HEALTH:''
      },
      formDataPC:{
        // F_DJABNORMALITY:'1',
        // F_L_ABNORMALITY:'1',
        // F_M_ABNORMALITY:'1',
        // F_G_ABNORMALITY:'1',
        // F_Z_ABNORMALITY:'1',
        // F_Z_M_ABNORMALITY:'1',
        // F_Z_G_ABNORMALITY:'1',
        // F_Z_ZABNORMALITY:'1',
        // F_C_Z_ABNORMALITY:'1',
        // F_C_H_ABNORMALITY:'1',
        // F_LG_WYC:'1',
        // F_WG_WYC:'1',
        // F_GZLJZC_WYC:'1',
        // F_WHFGQT:'1',
        // F_MENCHUANG:'1',
        // F_XIANGLINSHIGONG:'1',
        // F_SFDEMOLITION:'1',
        // F_XCJG:'1',
        // F_LISHIZAIHAI:'1',
        // F_ADDCENG:'1',
        // F_DUIXIANGJUZHU:'1',
        // F_QITASHUOMING:'1',
        F_DJABNORMALITY:'',
        F_L_ABNORMALITY:'',
        F_M_ABNORMALITY:'',
        F_WG_WYC:'',
        F_GZLJZC_WYC:'',
        F_Z_G_ABNORMALITY:'',
        F_Z_ZABNORMALITY:'',
        F_C_Z_ABNORMALITY:'',
        F_C_H_ABNORMALITY:'',
        F_SFDEMOLITION:'',
        F_GZLJZC_GGJLJCPS:'',
        F_ADDCENG:'',
        F_CHANGE:'',
        F_LG_WYC:'',
        F_SF_DANGEROUS:''
      },
      selectData:{
        currentDate:new Date(),
        showPickerq:false,
        IS1:false,
        ISARR1:[
          {
            text:'是',
            value:'204'
          },
          {
            text:'否',
            value:'205'
          },
        ],
        ISYSWF:'',
        F_HEALTH:'',
        HEALTH:false,
        HEALTHARR:[]
      },
      contentData: [
        {
          name: '场地',
          value:'11',
          children: [
            {
              name: '房屋周边地面是否长期积水',
              key:'F_DJABNORMALITY',
              value: '1'
            },
            {
              name: '房屋上装有大型广告牌',
              key:'F_L_ABNORMALITY',
              value: '1'
            },
            {
              name: '周边有工程建设和深基坑施工情况',
              key:'F_M_ABNORMALITY',
              value: '1'
            },
          ],
          fileData:[
            {
              name:'房屋及周边整体照片',
              groupGuid: "e64f6961-2aba-4b13-b7f1-d52048f3c982",
              fileList:[]
            }
          ]
        },
        {
          name: '地基基础检查',
          value:'11',
          children: [
            {
              name: '房屋出现明显不均匀沉降（斜向） 裂缝',
              key:'F_G_ABNORMALITY',
              value: '1'
            },
            {
              name: '外露基础明显腐蚀、酥碱、松散 和剥落',
              key:'F_Z_ABNORMALITY',
              value: '1'
            },
            {
              name: '裂缝持续发展尚未稳定',
              key:'F_Z_M_ABNORMALITY',
              value: '1'
            },
          ],
          fileData:[
            {
              name:'房屋整体照片',
              groupGuid: "924d7510-a6ee-4dfd-b796-75af88a3be7a",
              fileList:[]
            }
          ]
        },
        {
          name: '房屋检查',
          children: [
            {
              name:'砖砌墙',
              children:[
                {
                  name: '墙体普遍开裂，剥蚀严重',
                  key:'F_WG_WYC',
                  value: '1'
                },
                {
                  name: '纵横墙体交接处竖向开裂',
                  key:'F_GZLJZC_WYC',
                  value: '1'
                },
              ]
            },
            {
              name: '石砌墙',
              children: [
                {
                  name: '墙体普遍开裂或开裂严重，明显 空鼓，部分石料松动',
                  key:'F_Z_G_ABNORMALITY',
                  value: '1'
                },
                {
                  name: '纵横墙体交接处竖向开裂，墙体 有歪斜',
                  key:'F_Z_ZABNORMALITY',
                  value: '1'
                },
              ]
            },
            {
              name: '生土墙体',
              children: [
                {
                  name: '墙体开裂严重',
                  key:'F_C_Z_ABNORMALITY',
                  value: '1'
                },
                {
                  name: '墙面明显剥蚀，空鼓严重',
                  key:'F_C_H_ABNORMALITY',
                  value: '1'
                },
              ]
            },
            {
              name: '承重木构架',
              children: [
                {
                  name: '明显腐朽或虫蛀',
                  key:'F_SFDEMOLITION',
                  value: '1'
                },
                {
                  name: '梁、檩跨中明显变形或出现横向 裂缝，梁檩端部出现劈裂',
                  key:'F_GZLJZC_GGJLJCPS',
                  value: '1'
                },
              ]
            },
            {
              name: '梁、板、柱等混凝土构件',
              children: [
                {
                  name: '保护层剥落严重',
                  key:'F_ADDCENG',
                  value: '1'
                },
                {
                  name: '钢筋露筋、锈蚀，出现明显锈胀 裂缝',
                  key:'F_CHANGE',
                  value: '1'
                },

              ]
            },
            {
              name: '其他情况',
              children: [
                {
                  name: '其他存在危险性的情况',
                  key:'F_LG_WYC',
                  value: '1'
                },
              ]
            },
          ],
          fileData:[
            {
              name:'房屋东面、西面、北面、南面照片',
              groupGuid: "7814b787-5111-40ce-892f-c9cf5ecf2f53",
              fileList:[]
            }
          ]
        },
        {
          name: '结论',
          value:'111',
          type:'JL',
          children: [
            {
              name: '是否疑似危房',
              key:'F_SF_DANGEROUS',
              value: '1'
            },
          ],
        },
        // {
        //   name: '柱',
        //   children: [
        //     {
        //       name:'钢筋混凝土',
        //       nowIndex:0,
        //       value:'F_Z_ABNORMALITY',
        //       children:[
        //         {
        //           name: '无异常',
        //           value: '1'
        //         },
        //         {
        //           name: '明显变形',
        //           value: '2'
        //         },
        //         {
        //           name: '裂缝',
        //           value: '3'
        //         },
        //         {
        //           name: '钢筋锈蚀',
        //           value: '4'
        //         },
        //         {
        //           name: '混凝土胀裂',
        //           value: '5'
        //         }
        //       ]
        //     },
        //     {
        //       name: '木',
        //       nowIndex:0,
        //       value: 'F_Z_M_ABNORMALITY',
        //       children: [
        //         {
        //           name: '无异常',
        //           value: '1'
        //         },
        //         {
        //           name: '明显变形',
        //           value: '2'
        //         },
        //         {
        //           name: '裂缝',
        //           value: '3'
        //         },
        //         {
        //           name: '腐朽蛀蚀',
        //           value: '4'
        //         },
        //         {
        //           name: '节点连接',
        //           value: '5'
        //         }
        //       ]
        //     },
        //     {
        //       name: '钢',
        //       nowIndex:0,
        //       value: 'F_Z_G_ABNORMALITY',
        //       children: [
        //         {
        //           name: '无异常',
        //           value: '1'
        //         },
        //         {
        //           name: '明显变形',
        //           value: '2'
        //         },
        //         {
        //           name: '裂缝',
        //           value: '3'
        //         },
        //         {
        //           name: '锈蚀',
        //           value: '4'
        //         },
        //       ]
        //     },
        //     {
        //       name: '砖',
        //       nowIndex:0,
        //       value: 'F_Z_ZABNORMALITY',
        //       children: [
        //         {
        //           name: '无异常',
        //           value: '1'
        //         },
        //         {
        //           name: '明显变形',
        //           value: '2'
        //         },
        //         {
        //           name: '裂缝',
        //           value: '3'
        //         },
        //         {
        //           name: '风化粉化',
        //           value: '4'
        //         },
        //         {
        //           name: '受潮渗漏',
        //           value: '5'
        //         }
        //       ]
        //     },
        //   ]
        // },
        // {
        //   name: '承重墙体',
        //   children: [
        //     {
        //       name:'砖（砌体）',
        //       nowIndex:0,
        //       value:'F_C_Z_ABNORMALITY',
        //       children: [
        //         {
        //           name: '无异常',
        //           value: '1'
        //         },
        //         {
        //           name: '明显变形',
        //           value: '2'
        //         },
        //         {
        //           name: '裂缝',
        //           value: '3'
        //         },
        //         {
        //           name: '风化粉化',
        //           value: '4'
        //         },
        //         {
        //           name: '受潮渗漏',
        //           value: '5'
        //         }
        //       ]
        //     },
        //     {
        //       name: '混凝土',
        //       nowIndex:0,
        //       value: 'F_C_H_ABNORMALITY',
        //       children: [
        //         {
        //           name: '无异常',
        //           value: '1'
        //         },
        //         {
        //           name: '明显变形',
        //           value: '2'
        //         },
        //         {
        //           name: '裂缝',
        //           value: '3'
        //         },
        //         {
        //           name: '露筋锈蚀',
        //           value: '4'
        //         },
        //       ]
        //     },
        //   ]
        // },
        // {
        //   name: '盖楼',
        //   nowIndex:0,
        //   value: 'F_LG_WYC',
        //   children: [
        //     {
        //       name: '无异常',
        //       value: '1'
        //     },
        //     {
        //       name: '明显变形',
        //       value: '2'
        //     },
        //     {
        //       name: '裂缝',
        //       value: '3'
        //     },
        //     {
        //       name: '渗漏',
        //       value: '4'
        //     },
        //     {
        //       name: '老化破损',
        //       value: '5'
        //     },
        //   ]
        // },
        // {
        //   name: '屋盖',
        //   nowIndex:0,
        //   value: 'F_WG_WYC',
        //   children: [
        //     {
        //       name: '无异常',
        //       value: '1'
        //     },
        //     {
        //       name: '明显变形',
        //       value: '2'
        //     },
        //     {
        //       name: '裂缝',
        //       value: '3'
        //     },
        //     {
        //       name: '渗漏',
        //       value: '4'
        //     },
        //     {
        //       name: '老化破损',
        //       value: '5'
        //     },
        //   ]
        // },
        // {
        //   name: '构造连接支撑',
        //   nowIndex:0,
        //   value: 'F_GZLJZC_WYC',
        //   children: [
        //     {
        //       name: '无异常',
        //       value: '1'
        //     },
        //     {
        //       name: '先天缺陷（为设支撑，结构构造简易）',
        //       value: '2'
        //     },
        //     {
        //       name: '明显变形',
        //       value: '3'
        //     },
        //     {
        //       name: '各构件连接处破损',
        //       value: '4'
        //     },
        //   ]
        // },
        // {
        //   name: '围护分割墙体',
        //   value: 'F_WHFGQT',
        //   nowIndex:0,
        //   children: [
        //     {
        //       name: '无异常',
        //       value: '1'
        //     },
        //     {
        //       name: '轻微损伤',
        //       value: '2'
        //     },
        //     {
        //       name: '严重损伤',
        //       value: '3'
        //     },
        //     {
        //       name: '受潮渗漏',
        //       value: '4'
        //     },
        //   ]
        // },
        // {
        //   name: '门窗',
        //   value: 'F_MENCHUANG',
        //   nowIndex:0,
        //   children: [
        //     {
        //       name: '无异常',
        //       value: '1'
        //     },
        //     {
        //       name: '明显变形',
        //       value: '2'
        //     },
        //     {
        //       name: '老化破损',
        //       value: '3'
        //     },
        //   ]
        // },
        // {
        //   name: '相邻施工',
        //   value: 'F_XIANGLINSHIGONG',
        //   nowIndex:0,
        //   children: [
        //     {
        //       name: '无施工',
        //       value: '1'
        //     },
        //     {
        //       name: '施工振动',
        //       value: '2'
        //     },
        //     {
        //       name: '地下水位下降',
        //       value: '3'
        //     },
        //     {
        //       name: '土体扰动',
        //       value: '4'
        //     },
        //     {
        //       name: '其他',
        //       value: '5'
        //     },
        //   ]
        // },
        // {
        //   name: '结构拆改',
        //   nowIndex:0,
        //   value:'F_SFDEMOLITION',
        //   children: [
        //     {
        //       name: '无拆改',
        //       value: '1'
        //     },
        //     {
        //       name: '一般拆改',
        //       value: '2'
        //     },
        //     {
        //       name: '严重拆改',
        //       value: '3'
        //     },
        //   ]
        // },
        // {
        //   name: '修缮加固',
        //   value: 'F_XCJG',
        //   nowIndex:0,
        //   children: [
        //     {
        //       name: '正常使用无加固',
        //       value: '1'
        //     },
        //     {
        //       name: '质量原因加固',
        //       value: '2'
        //     },
        //     {
        //       name: '灾害原因加固',
        //       value: '3'
        //     },
        //     {
        //       name: '使用功能原因加固',
        //       value: '4'
        //     },
        //     {
        //       name: '其他加固',
        //       value: '5'
        //     },
        //   ]
        // },
        // {
        //   name: '历史灾害',
        //   nowIndex:0,
        //   value: 'F_LISHIZAIHAI',
        //   children: [
        //     {
        //       name:'无历史灾害',
        //       value: '1'
        //     },
        //     {
        //       name: '火灾',
        //       value: '2'
        //     },
        //     {
        //       name: '风灾',
        //       value: '3'
        //     },
        //     {
        //       name: '雪灾',
        //       value: '4'
        //     },
        //     {
        //       name: '水灾',
        //       value: '5'
        //     },
        //     {
        //       name: '地质',
        //       value: '6'
        //     },
        //     {
        //       name: '其他',
        //       value: '7'
        //     },
        //   ]
        // },
        // {
        //   name: '功能变更',
        //   nowIndex:0,
        //   value: 'F_ADDCENG',
        //   children: [
        //     {
        //       name:'无变更',
        //       value: '1'
        //     },
        //     {
        //       name: '住宅变商业用房',
        //       value: '2'
        //     },
        //     {
        //       name: '住宅变办公用房',
        //       value: '3'
        //     },
        //     {
        //       name:'办公变商业用房',
        //       value: '4'
        //     },
        //     {
        //       name: '工业用房变商业用房',
        //       value: '5'
        //     },
        //     {
        //       name: '工业用房变办公用房',
        //       value: '6'
        //     },
        //     {
        //       name: '其他',
        //       value: '7'
        //     },
        //   ]
        // },
        // {
        //   name: '对象居住状态',
        //   nowIndex:0,
        //   value: 'F_DUIXIANGJUZHU',
        //   children: [
        //     {
        //       name:'有人居住',
        //       value: '1'
        //     },
        //     {
        //       name: '无人居住',
        //       value: '2'
        //     },
        //   ]
        // },
      ],
      JBXXcontentData:[
        {
          name:'姓名',
          value:'F_HOUSEAPPLICANT'
        },
        {
          name:'身份证号',
          value:'F_CERTIFICATECODE'
        },
        {
          name:'手机号',
          value:'F_APPLYPHONE'
        },
        {
          name:'户籍地址',
          value:'F_PERMANENTADDR'
        },
        {
          name:'申请方式',
          value:'F_SQFS',
          children:[]
        },
        {
          name:'代办人姓名',
          value:'F_DBRXM',
        },
        {
          name:'代办人身份证号',
          value:'F_DBRSFZH',
        },
        {
          name:'代办人手机号',
          value:'F_DBRSJH',
        },
        {
          name:'所属市',
          value:'F_SCITY2'
        },
        {
          name:'所属县',
          value:'F_XCITY2'
        },
        {
          name:'所属村',
          value:'F_VILLAGE2'
        },
        {
          name:'所属镇',
          value:'F_SSZZ2'
        },
        {
          name:'东至',
          value:'F_DONG'
        },
        {
          name:'西至',
          value:'F_XIZHI'
        },
        {
          name:'南至',
          value:'F_NANZHI'
        },
        {
          name:'北至',
          value:'F_BEIZHI'
        },
        {
          name:'房屋编码',
          value:'F_FWTYBH'
        },
        {
          name:'檐口高度',
          value:'F_BUILDHEIGHT'
        },
        {
          name:'宅基地面积',
          value:'F_HOMESTEADAREA'
        },
        {
          name:'住房建筑面积',
          value:'F_HOUSEFLOORAREA'
        },
        {
          name:'占地面积',
          value:'F_BUILDAREA'
        },
        {
          name:'建筑层数',
          value:'F_BUILDSTOREY'
        },
        {
          name:'地类_农用地',
          value:'F_DL_NYD',
          children:[]
        },
        {
          name:'地类_农用地_其他',
          value:'F_YDLX_NYD_QT'
        },
        {
          name:'用地类型',
          value:'F_YDLX',
          children:[]
        },
        {
          name:'建设类型',
          value:'F_APPLYTYPE',
          children:[]
        },
        {
          name:'地址',
          value:'F_CONSTRUCITONADDRESS'
        },
      ],
      rowData:{},
      IFYSWF:[]
    }
  },
  // window.g.locateMapUrl
  filters: {
    inUseName: function (msg, data) {
      let name = "";
      data.forEach((item) => {
        if (item.DICID == msg) {
          name = item.DICNAME;
        }
      });
      return name;
    },
  },
  methods: {
    getList(item) {
      this.groupGuids = item.groupGuid;
    },
    locateMapUrl(){
      let url =  window.g.locateMapUrl+"?Address="+this.rowData.F_CONSTRUCITONADDRESS
      if(this.rowData.F_CONSTRUCITONADDRESS){
        dd.ready(function () {
          dd.openLink({
            url: url
          })
            .then(res => {
            })
            .catch(err => {
              window.open(url)
              console.error(err)
            })
        })
      }
    },
    afterRead(file) {
      this.getFileServerUpload(file.file)
    },
    delectFile: async function (file) {
      let fileguid = ''
      if (file.ROW_GUID) {
        fileguid = file.ROW_GUID
      } else {
        fileguid = this.fileGuid
      }
      if (fileguid) {
        let params = {
          accessCode: 'ce9b691634de4ebca68dc5bb638d07f4',
          cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
          params: {
            fileGuid: fileguid,
            token: window.localStorage.getItem('token')
          }
        }
        const res = await FileServerProxy(params)
        let data = JSON.parse(res.data.data).Success
        if (data) {
          this.$toast.success('删除成功!')
        }
      }
    },
    getFileServerUpload: async function (file) {
      let data = {
        toRowGuid: this.rowData.ROW_GUID,
        groupGuid: this.groupGuids,
        token: window.localStorage.getItem('token')
      }
      let formData = new FormData()
      formData.append('file', file)
      formData.append('accessCode', '7a3fc061c866434b8475d3775c9ddcea')
      formData.append('cityCode',window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000' )
      formData.append('token', window.localStorage.getItem('token'))
      formData.append('paramStr', JSON.stringify(data))
      const res = await dataTransFile(formData)
      let data1 = JSON.parse(res.data.data).FileList
      this.fileGuid = data1[0].FILEGUID
      if (data1[0].FILEGUID) {
        this.$toast.success('上传成功!')
      }
    },
    onConfirmRQ(val){
      let year = val.getFullYear()
      let month = val.getMonth() + 1
      let day = val.getDate()
      let hour = val.getHours()
      let minute = val.getMinutes()
      if (month >= 1 && month <= 9) {
        month = `0${month}`
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`
      }
      this.formDataGZ.F_TROUBLESHOOTINGTIME = `${year}-${month}-${day}`
      this.selectData.showPickerq = false
    },
    confirmHEALTH(val){
      this.formDataGZ.F_HEALTH = val.DICID
      this.selectData.F_HEALTH = val.DICNAME
      this.selectData.HEALTH = false
    },
    confirmIS(val){
      this.formDataGZ.F_SF_DANGEROUS = val.value
      this.selectData.ISYSWF = val.text
      this.selectData.IS1 = false
    },
    getEnumeration: async function (dataguid) {
      let params = {
        accessCode: "688bd3883572440a859dfd8ba9194e7b",
           cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
        params: {
          dataguid: dataguid,
          searchObject: JSON.stringify([]),
          token: window.localStorage.getItem("token"),
        },
      };
      const res = await FileServerProxy(params);
      let data = JSON.parse(res.data.data).Data
      switch (dataguid) {
        case 'b6c020ad-16bb-4616-a77b-0d19609ed70d':
          this.IFYSWF = data
          break
        case 'db35edee-88e0-4fae-b14a-868ed4beb1d9':
          this.JBXXcontentData.forEach((item,index)=>{
            if(item.name==='建设类型'){
              item.children = data
            }
          })
          break
        case 'd2ec96d4-b5bc-404a-a9f1-34db915c694b':
          this.JBXXcontentData.forEach((item,index)=>{
            if(item.name==='用地类型'){
              item.children = data
            }
          })
          break
        case '52215e71-341a-452b-8823-a8d4aae058ab':
          this.JBXXcontentData.forEach((item,index)=>{
            if(item.name==='地类_农用地'){
              item.children = data
            }
          })
          break
        case 'c7e2cc1c-1757-4ebb-af08-4fb7bc53ac15':
          this.JBXXcontentData.forEach((item,index)=>{
            if(item.name==='申请方式'){
              item.children = data
            }
          })
          break
      }
    },
    onClickLeft () {
      this.$router.push({
        path: "/keyInvestigation",
      });
    },
    btnClick(index,item,item1){
      item.nowIndex  = index
      this.formDataPC[item.value] = item1.value
    },
    saveData: async function (){
      // 排查信息
      let data = this.formDataPC
      data.TO_ROW_GUID = this.rowData.ROW_GUID
      let params = {
        accessCode: '',
        cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
        params: {
          dataGuid: '7ea2ff29-1d42-48d0-b165-9645c459f937',
          strParams: JSON.stringify([data]),
          token: window.localStorage.getItem('token')
        }
      }
      if (true) {
        params.accessCode = '0fb3f6123d1b4fe6851c99532c463f6f'
        const res = await FileServerProxy(params)
        let data = JSON.parse(res.data.data).Success
        // if (data) {
        //   this.$toast.success('成功！')
        // }
      } else {
        params.accessCode = '77ad6c1591e54d4fbc45ecc90374a2a2'
        const res = await FileServerProxy(params)
        let data = JSON.parse(res.data.data).Success
        if (data) {
          this.$toast.success('修改成功!')
        }
      }

      // 危房上报
      let data1 = this.formDataGZ
      data1.ROW_GUID = this.rowData.ROW_GUID
      data1.PKID = this.rowData.PKID
      data1.F_PCSTATUS = "203"
      let params1 = {
        accessCode: '',
        cityCode: window.localStorage.getItem('citycode') ? window.localStorage.getItem('citycode') : '441300000000',
        params: {
          dataGuid: 'b5b215cd-d84c-494d-94f7-a9f4c273a9a8',
          strParams: JSON.stringify([data1]),
          token: window.localStorage.getItem('token')
        }
      }
        params1.accessCode = '77ad6c1591e54d4fbc45ecc90374a2a2'
        const res = await FileServerProxy(params1)
        let data2 = JSON.parse(res.data.data).Success
        if (data2) {
          this.$toast.success('成功!')
        }
    },
    //获取相关材料
    getFile: async function () {
      let groupGuid = [];
      this.contentData.forEach((item) => {
        if(item.fileData){
          item.fileData.forEach((items) => {
            groupGuid.push(items.groupGuid);
          });
        }
      });
      let params = {
        accessCode: "1fdcbce42c6d4748a020feba618d54b8",
           cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "",
        params: {
          groupGuid: groupGuid.join(","),
          toRowGuid: this.rowData.ROW_GUID,
          token: window.localStorage.getItem('token')
        },
      };
      const res = await FileServerProxy(params);
      let data = JSON.parse(res.data.data).FilesInfo;
      if (data.length > 0) {
        data.forEach((element) => {
          this.contentData.forEach((items) => {
            if (items.fileData){
              if (items.fileData.length>0) {
                items.fileData.forEach((cc) => {
                  if (element.GROUPGUID == cc.groupGuid) {
                    this.getFileUrl(element, cc);
                    // element["isImage"] = true;
                    // element["url"] =
                    //   window.g.BaseURL +
                    //   "FileServer/api/Preview?token=" +
                    //   window.localStorage.getItem("token") +
                    //   "&" +
                    //   "fileGuid=" +
                    //   encodeURIComponent(element.ROW_GUID);
                    // cc.fileList.push(element);
                  }
                });
              }
            }
          });
        });
      }
    },
    //获取附件文件流
    getFileUrl: async function (element, item) {
      let formData = new FormData();
      formData.append("accessCode", "98bcf528966e48ce896a8b3fd02d45d5");
      formData.append(
        "cityCode",
        window.localStorage.getItem("citycode")
          ? window.localStorage.getItem("citycode")
          : "441300000000"
      );
      formData.append(
        "paramStr",
        JSON.stringify({
          fileGuid: element.ROW_GUID,
        })
      );
      let response = await dataTransFilePreview(formData);
      if (response) {
        var img = new Blob([new Int8Array(response.data, 0)], {
          type: response.headers["content-type"],
        }); //type类型可自定义
        element["isImage"] = true;
        element["url"] = window.URL.createObjectURL(img);
        item.fileList.push(element);
      }
    },
    // 获取数据
    getData: async function () {
      let params = {
        accessCode: "688bd3883572440a859dfd8ba9194e7b",
           cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
        params: {
          dataguid: "7ea2ff29-1d42-48d0-b165-9645c459f937",
          searchObject: JSON.stringify([
            { field: "to_row_guid", value: this.rowData.ROW_GUID, operator: "=" },
          ]),
          token: window.localStorage.getItem("token"),
        },
      };
      const res = await FileServerProxy(params);
      let data = JSON.parse(res.data.data).Data;
      // if (data.length > 0) {
      //   for (let i in this.formData) {
      //     this.formData[i] = data[0][i];
      //   }
      // }
      // if (data.length > 0) {
      //   this.ROW_GUID = data[0].ROW_GUID;
      //   this.isAdd = false;
      // } else {
      //   this.ROW_GUID = this.newGuid();
      //   this.isAdd = true;
      // }
    },
  },
  mounted(){

    this.getEnumeration("b6c020ad-16bb-4616-a77b-0d19609ed70d")
    // this.getEnumeration("db35edee-88e0-4fae-b14a-868ed4beb1d9")
    // this.getEnumeration("d2ec96d4-b5bc-404a-a9f1-34db915c694b")
    // this.getEnumeration("52215e71-341a-452b-8823-a8d4aae058ab")
    // this.getEnumeration("c7e2cc1c-1757-4ebb-af08-4fb7bc53ac15")
    this.rowData = JSON.parse(this.$route.query.data)
    this.getFile()
    // this.getData()
    dd.ready(function () {
      dd.setTitle({
        title: '详细信息'
      })
        .then(res => {
        })
        .catch(err => {
          console.error(err)
        })
    })
  }
}
</script>
<style scoped lang="scss">
#KeyCheckNInfo {
  height: 100vh;
  overflow: auto;
  background: #f6f6f6;
  .btn-style{
    width:100%;
    height:auto;
    /*line-height: 40px;*/
    border-bottom: 1px solid #CCCCCC;
    display: inline-block;
    margin-right: 10px;
    font-size: 14px;
  }
  .select{
    background: #007AFF;
    color: #fff;
  }
  /*font-size: 14px;*/
  .title {
    width: 100%;
    height: 50px;
    background: #007aff;
    line-height: 50px;
    text-align: center;
    color: #ffffff;
    font-size: 20px;
    position: relative;
  }
  .top {
    height: 122px;
    background: #ffffff;
    margin-bottom: 20px;
    padding-top: 35px;
    text-align: center;
    .origin {
      width: 22px;
      height: 22px;
      background: #007aff;
      border-radius: 50%;
      display: inline-block;
    }
    .line {
      width: 20vw;
      /*height: 1px;*/
      border: 1px dashed #007aff;
      display: inline-block;
    }
  }
  .content {
    width: 100%;
    height: auto;
    background: #ffffff;
    padding: 10px;
    .line {
      width: 6px;
      height: 26px;
      background: #007aff;
      display: inline-block;
    }
    .list ul li {
      min-height: 40px;
      line-height: 40px;
    }
  }
}
</style>
<style lang="scss">
#KeyCheckNInfo {
  .van-cell{
    padding: 10px 0;
  }
  .el-checkbox-button {
    margin-left: 3px;
    .el-checkbox-button__inner {
      border-radius: 30px;
      border-left: 1px solid #dcdfe6;
    }
  }
  .el-checkbox-button:nth-child(1) {
    margin-left: 0px;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409eff;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
  .el-input__inner {
    border: none;
  }
}
</style>
